#ifndef GAMECONTROL_H
#define GAMECONTROL_H

#include <QPainter>
#include <QDebug>

#include "message.h"

class GameControl
{
    bool isPlaying;
    bool isPlayer;
    int celW;
    int celH;
    int row;
    char *gameData;
    int *playerData;
    int *computerData;
    char data;
    Message *msg;

    void setData(QPoint p);
    void setPlayerData();
    void setComputerData();
    bool checkWin();

public:
    GameControl(){}
    GameControl(int w, int h, int r);
    ~GameControl();

    void initData();
    void setPlaying(bool b);
    void setPlayer(bool b);
    void setCelW(int w);
    void setCelH(int h);
    void setRow(int r);
    bool getIsPlaying();
    bool getIsPlayer();
    QPoint translate(QPoint p);//转换坐标
    bool isPlayerWin();
    bool isComputerWin();
    bool isNoPlace();
    bool isHaveChess(QPoint p);
    QPoint computerMove();
    int countScore(int count);

};

#endif // GAMECONTROL_H
